package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-03-14
 * Time: 20:48
 */
public class Dog extends Animal{
    public Dog(String name, int age) {
        super(name, age);
    }

    @Override//方法重写
    public void eat() {
        System.out.println(this.name + "正在吃狗粮");
    }
    @Override//构成父子关系也是重写
    public Dog sport(){
        System.out.println(this.name + "正在奔跑");
        return null;
    }
    public void hunt(){
        System.out.println(this.name + "正在狩猎");
    }
}
